<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserCategory
 *
 * @author pbarrenechea
 */
class CMS_Models_UserCategory extends Zend_Db_Table_Abstract
{
    protected $_name = "user_category";

    public function getAll()
    {
        return $this->fetchAll();
    }

    public function getCategoryById($id) {
        $cat = $this->fetchAll("id = '$id'");
        return $cat[0];
    }

    public function getName($id)
    {
    	$category = $this->fetchAll("id = '$id'");
    	return $category[0]['name'];
    }

    public function lastId()
    {
    	return TN_Db::getInstance()->lastInsertId('user_category');
    }

}
?>
